package cn.jbolt.index;

import com.jfinal.aop.Inject;
import com.jfinal.core.Controller;
import com.jfinal.kit.HttpKit;
import com.jfinal.kit.JsonKit;

import cn.hutool.log.Log;
import cn.jbolt.common.model.FilesIdx;
import cn.jbolt.common.service.LreaService;
import cn.jbolt.common.vo.FileAttach;
import cn.jbolt.common.vo.LandInfoVo;

/**
 * IndexController 指向系统访问首页
 * 
 * @author jbolt.cn
 * @email 909854136@qq.com
 * @date 2018年11月4日 下午9:02:52
 */
public class IndexController extends Controller {

	static Log LOG = Log.get(IndexController.class);

	@Inject
	LreaService service;

	/**
	 * 首页Action
	 */
	public void index() {
		render("index.html");
	}

	public void querylandInfo() {
		String str = HttpKit.readData(getRequest());
		LOG.info(str);
		LandInfoVo landInfo = new LandInfoVo();
		if (str != null) {
			landInfo = JsonKit.parse(str, LandInfoVo.class);
		}
		renderJson(service.findLandReg(landInfo));
	}

	public void getAttacheFileList(String fileBarCode) {
		renderJson(service.findEa(fileBarCode));
	}

	public void getAttacheFile() {
		String str = HttpKit.readData(getRequest());
		FileAttach file = JsonKit.parse(str, FileAttach.class);
		renderJson(service.findFile(file));
	}
	

}